﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Drawing;
using System.ComponentModel.Design;
using System.Drawing.Design;
using XDesigner.AppFramework.DOM;

namespace XDesigner.AppFramework.Designer
{
    public class AppCategoryNameEditor : XDesigner.Editor.CustomDrawValueListBoxEditor
    {
        protected override void FillListBox(System.Windows.Forms.ListBox ctl, ITypeDescriptorContext context)
        {
            foreach (AppCategory item in AppFrameworkDesigner.GetDesignTimeFramework(context).Categorys)
            {
                ctl.Items.Add(item);
            }
            ctl.DisplayMember = "DisplayName";
            ctl.ValueMember = "Name";
        }

        public override Size BoxSize
        {
            get
            {
                return Size.Empty;
            }
        }

        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object Value)
        {

            return base.EditValue(context, provider, Value);
        }
         
    }
}
